<!doctype html>
<html>
<head>
    <title>{{ title }}</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="card mt-5">
                    <div class="card-header">
                        <h3 class="text-center">注册</h3>
                    </div>
                    <div class="card-body">
                        <form method="post">
                            {{ form.hidden_tag() }}
                            <div class="mb-3">
                                {{ form.username.label(class="form-label") }}
                                {{ form.username(class="form-control") }}
                                {% for error in form.username.errors %}
                                    <div class="text-danger">{{ error }}</div>
                                {% endfor %}
                            </div>
                            <div class="mb-3">
                                {{ form.email.label(class="form-label") }}
                                {{ form.email(class="form-control") }}
                                {% for error in form.email.errors %}
                                    <div class="text-danger">{{ error }}</div>
                                {% endfor %}
                            </div>
                            <div class="mb-3">
                                {{ form.password.label(class="form-label") }}
                                {{ form.password(class="form-control") }}
                                {% for error in form.password.errors %}
                                    <div class="text-danger">{{ error }}</div>
                                {% endfor %}
                            </div>
                            <div class="mb-3">
                                {{ form.password2.label(class="form-label") }}
                                {{ form.password2(class="form-control") }}
                                {% for error in form.password2.errors %}
                                    <div class="text-danger">{{ error }}</div>
                                {% endfor %}
                            </div>
                            {{ form.submit(class="btn btn-primary w-100") }}
                        </form>
                        <div class="text-center mt-3">
                            <a href="{{ url_for('auth.login') }}">已有账户？点击登录</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>